#include "virtual_db_helper.h"
#include "db/db_oper_code.h"
#include <string>
#include <stdio.h>
#include <string.h>

#include "inc/_oralib.h"


using namespace std;
using namespace oralib;

bool VirtualHelper::connect()
{
    return true;
}

bool VirtualHelper::disconnect()
{
    return true;
}

bool VirtualHelper::GetLoginLogData(int& ret_code, LoginLogList& list, char* debug)
{
    list.Clean();
    ret_code = DBO_SUCCESS;

    uint32_t account_id;
    std::string name = "test";
    oralib::datetime login_time;
    oralib::datetime logout_time;
    uint32_t online_time = 200;
    std::string ip = "127.0.0.1";
    uint32_t port = 1234;
    uint32_t serverid = 20000;

    login_time.year(2011);
    login_time.mon(aug);
    login_time.day(1);
    login_time.hour(10);
    login_time.minute(10);
    login_time.sec(10);

    uint32_t total_counts = 1000;
    int i = 1;
    while(total_counts-- > 0)
    {
        account_id = i++;
        list.AddNode(account_id, name.c_str(), login_time, logout_time, online_time,
                     ip.c_str(), port, serverid);

    }
    return true;

}
